package com.tyd.cams.ui.schedule;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import com.tyd.cams.R;
import com.tyd.cams.utils.SPUtils;

public class ScheduleFragment extends Fragment {

    private WebView webView;
    public WebSettings webSettings;

    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_schedule, container, false);

        webView = root.findViewById(R.id.kebiaoWebView);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl(SPUtils.getIP()+"/schedule/mtoIndex");
        webSettings=webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setUseWideViewPort(true);//自适应屏幕
        webSettings.setLoadWithOverviewMode(true);//自适应屏幕
        webSettings.setBuiltInZoomControls(true);//自动缩放
        webSettings.setSupportZoom(true);//自动缩放
        return root;
    }
}